package utils;

import common.Constant;

/**
 * @Author lzc
 * @Date 2022/10/10 14:58
 */
public class SQLUtil {

    public static String getKafkaSource(String topic, String groupId) {

        return "with(" + " 'connector' = 'kafka', " + " 'topic' = '" + topic + "', " + " 'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "', " + " 'properties.group.id' = '" + groupId + "', " + " 'scan.startup.mode' = 'latest-offset', " + " 'format' = 'json'" + ")";
    }


    public static String getKafkaSink(String topic) {
        return "with(" + " 'connector' = 'kafka', " + " 'topic' = '" + topic + "', " + " 'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "', " + " 'format' = 'json'" + ")";
    }
}
